<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<title><?php echo ($name); ?></title>
<script src="__APP__/statics/jquery-1.9.1.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="__APP__/statics/css/jNotify.jquery.css" />
<script type="text/javascript" src="__APP__/statics/jNotify.jquery.js"></script>
<style>
 body{font-family:"微软雅黑";font-size:12px;color:#666666;background-color:#F9F9F6}
 *{margin: 0;} 
 a{text-decoration:none}
 img{border:0px}
.cat{background-color:#F9F9F6;margin-left:10px;z-index:0;}
.cat_list:hover{background-color:#fff;}
.title{background:url("__APP__/statics/tbg.gif");font-weight:bold}

#save{text-align:center;border:0;width:100%;height:40px;background-color:#fff;position:fixed;left:0px;bottom:0px;z-index:999;border:1px solid #DFDFDF;background-color:#DFDFDF;padding:5px;height:20px}
</style>

<style>
input{padding:6px;}
.title{background:#E2E8EB;width:180px;text-align:right;}
</style>

<a href="__URL__/addAdmin"><input type="button" value="添加管理员"></a>
<table border="0" width="100%" align="center" cellspacing="3" cellpadding="3">
	<tr>
		<td width="10%">账号</td>
		<td width="10%">角色</td>
		<td width="10%">最近登录</td>
		<td width="30%">权限</td>
		<td width="10%">修改</td>
		<td width="10%">删除</td>
	</tr>
<?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$admin): $mod = ($i % 2 );++$i;?><tr>
		<td><?php echo ($admin["uname"]); ?></td>
		<td><?php echo ($admin["role"]); ?></td>
		<td><?php echo (date("Y/m/d H:i:s",$admin["last_time"])); ?></td>
		<td><?php echo ($admin["perm"]); ?></td>
		<td><a href="__URL__/updateAdmin/?id=<?php echo ($admin["id"]); ?>">修改</a></td>
		<td><?php if($admin["uname"] != 'pangudashu'): ?><a href="javascript:;" onclick="delAdmin(<?php echo ($admin["id"]); ?>)">删除</a><?php endif; ?></td>
	</tr><?php endforeach; endif; else: echo "" ;endif; ?>
</table>


<div id="save"><input type="button" id="change" value="保存修改" style="padding:2px"></div>

<script>
function delAdmin(t){
	if(confirm('你确定要删除此用户吗')) {
		$.get('__URL__/delAdmin',{id:t},function(res){
			jSuccess("<strong>修改成功！</strong>",{TimeShown : 500,VerticalPosition : 'center',HorizontalPosition : 'center',onClosed:function(){location.reload();}})
		})
	}
}
</script>